package com.ly.web.controller.erp;

import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.KingInvoiceTypeMappingEntity;
import com.ly.heart.service.IKingInvoiceTypeMappingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 发票类型映射 前端控制器
 * </p>
 * @author WuZH
 * @since 2024-08-18
 */
@Api (value = "KingInvoiceTypeMapping", tags = "发票类型映射")
@RestController
@RequestMapping ("/KingInvoiceTypeMapping")
public class KingInvoiceTypeMappingController {

    @Resource
    private IKingInvoiceTypeMappingService iKingInvoiceTypeMappingService;


    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:list')")
    @GetMapping ("/list")
    @ApiOperation ("发票类型映射列表")
    public AjaxResult list (KingInvoiceTypeMappingEntity kingInvoiceTypeMappingEntity) {
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:query')")
    @GetMapping (value = "/{id}")
    @ApiOperation ("获取发票类型映射详细信息")
    public AjaxResult getInfo (@PathVariable ("id") String id) {
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:add')")
    @Log (title = "暂存发票类型映射", businessType = BusinessType.INSERT)
    @PostMapping ("draft")
    @ApiOperation ("暂存发票类型映射")
    public AjaxResult draft (@RequestBody KingInvoiceTypeMappingEntity kingInvoiceTypeMappingEntity) {
        AjaxResult draft = iKingInvoiceTypeMappingService.draft ( kingInvoiceTypeMappingEntity );
        return draft;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:add')")
    @Log (title = "提交发票类型映射", businessType = BusinessType.INSERT)
    @PostMapping ("submit")
    @ApiOperation ("提交发票类型映射")
    public AjaxResult submit (@RequestBody KingInvoiceTypeMappingEntity kingInvoiceTypeMappingEntity) {
        AjaxResult submit = iKingInvoiceTypeMappingService.submit ( kingInvoiceTypeMappingEntity );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:edit')")
    @Log (title = "修改发票类型映射", businessType = BusinessType.UPDATE)
    @PutMapping
    @ApiOperation ("修改发票类型映射")
    public AjaxResult updateSingle (@RequestBody KingInvoiceTypeMappingEntity kingInvoiceTypeMappingEntity) {
        AjaxResult submit = iKingInvoiceTypeMappingService.updateSingle ( kingInvoiceTypeMappingEntity );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:remove')")
    @Log (title = "删除发票类型映射", businessType = BusinessType.DELETE)
    @DeleteMapping ("/{ids}")
    @ApiOperation ("删除发票类型映射")
    public AjaxResult deleteSingle (@PathVariable String[] ids) {
        AjaxResult submit = iKingInvoiceTypeMappingService.deleteSingle ( ids );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:KingInvoiceTypeMapping:remove')")
    @Log (title = "禁用发票类型映射")
    @RequestMapping ("disabled")
    @ApiOperation ("禁用发票类型映射")
    public AjaxResult disabled (String id) {
        AjaxResult submit = iKingInvoiceTypeMappingService.disabled ( id );
        return submit;
    }


}
